home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #058 (199x)(Scope PD)(US)[WB].zip / Scope Disk #058 (199x)(Scope PD)(US)[WB].adf / B1Subs / PaletRead (.txt) < prev    next >
AmigaBASIC Source Code  |  1989-01-24  |  632b  |  30 lines

  1. 'ReadColors
  2.  
  3.  ' CHDIR ":BMAPS"
  4.   LIBRARY "intuition.library"
  5.   DECLARE FUNCTION ViewPortAddress&() LIBRARY
  6.  
  7. ColorRead:
  8.   COLOR 3:LOCATE 24,15:PRINT "WORKING!";
  9.   COLOR 1:LOCATE 1,1
  10.   FOR ColorNum=0 TO WINDOW(6)
  11.     vpa&=ViewPortAddress&(WINDOW(7))
  12.     ColorTable&=PEEKL(PEEKL(vpa&+4)+4)
  13.     r=PEEK(ColorTable&+2*ColorNum)
  14.     b.g=PEEK(ColorTable&+2*ColorNum+1)
  15.     g=b.g\16
  16.     b=b.g MOD 16
  17.     SOUND 60*RND+100,1,80,RND*2+1
  18.     C$(ColorNum+1)=STR$(ColorNum)+","+STR$(r/16)+","+STR$(g/16)+","+STR$(b/16)
  19.      PRINT "Color #";ColorNum;"HEX  R=";r;"G=";g;", B=";b
  20.      PRINT "PALETTE";ColorNum;",";r/16;",";g/16;",";b/16
  21.      PRINT 
  22.   NEXT 
  23.   COLOR 2
  24. 'RETURN
  25. COLOR 1
  26. LIBRARY CLOSE
  27. END
  28.  
  29.  
  30.